﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPrincipal.master" AutoEventWireup="true"
    CodeFile="CadastrarUsuarioAG.aspx.cs" Inherits="Usuario_CadastrarUsuario" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="../scripts/tiny_mce/themes/simple/skins/default/ui.css" rel="stylesheet"
        type="text/css" />
    <script src="../scripts/jquery-1.6.1.min.js" type="text/javascript"></script>
    <script src="../scripts/fswgrid-0.2.js" type="text/javascript"></script>
    <script src="../scripts/json2.js" type="text/javascript"></script>
    <link href="../Css/geral.css" rel="stylesheet" type="text/css" />  
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
    <script type="text/javascript" src="../scripts/jquery.maskedinput-1.3.min.js"></script>
    <link href="../Teste/jQueryUI/development-bundle/themes/flick/jquery.ui.all.css" rel="stylesheet" type="text/css" />
    <script src="../scripts/calendario.js" type="text/javascript"></script>
    <script src="../scripts/jquery.blockUI.js" type="text/javascript"></script>

    <script type="text/javascript">
        $(document).ready(function(){
            $("#textNascimento").mask("99/99/9999");
            $("#textUf").mask("aa");           
        });
        
        function cadastrarUsuario(){
            if($('#textRepetirSenha').val() == $('#textSenha').val())
            {
                $.ajax({
                    type: "POST",
                    url: "CadastrarUsuarioAG.aspx/cadastrarUsuario",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    data: JSON.stringify({nome: $('#textNome').val(), dataNascimento: $('#textNascimento').val(),sexo: $('#textSexo').val(),
                    cidade: $('#textCidade').val(),uf: $('#textUf').val(),lates: $('#textLates').val(),instituicao: $('#textInstituicao').val(),
                    curso: $('#textCurso').val(),login: $('#textLogin').val(),senha: $('#textSenha').val(),email: $('#textEmail').val(), minicurriculo: $('#textMinicurriculo').val()}),
                    success: 
                        function (msg) {
						    if(msg.d == true)
                            {
                                $.growlUI('Cadastrado com sucesso !');
						        window.location = "GerenciarUsuarioAG.aspx";
                            }
                            else
                                $.growlUI('Usuário ja existe !');  
                        },
                });
            }
            else
                alert('Repita a senha corretamente!');
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderConteudo" runat="Server">
    <asp:Label ID="LabelNovoUsuario" Text="Novo Usuário" style="margin: 20px" Font-Size="20px" Font-Bold="true"
        runat="server"></asp:Label>
   
    <fieldset style="width: 80%; margin: 20px">
       <legend><h3>Dados do Usuário</h3></legend>
    <table>
    
        <tr>
            <td style="width: 45%">
                Nome:
            </td>
            <td style="width: 80%">
                <input id="textNome" type="text" />
            </td>
        </tr>
        <tr>
            <td style="width: 45%">
                Data de Nascimento:
            </td>
            <td style="width: 80%">
                <input id="textNascimento" type="text" />
            </td>
        </tr>
        <tr>
            <td style="width: 45%">
                Sexo:
            </td>
            <td style="width: 80%">
            <select id="textSexo">
                <option>Masculino</option>
                <option>Feminino</option>
            </select>
            </td>
        </tr>
        <tr>
            <td style="width: 45%">
                Cidade:
            </td>
            <td style="width: 80%">
                <input id="textCidade" type="text" />
            </td>
        </tr>
        <tr>
            <td style="width: 45%">
                UF:
            </td>
            <td style="width: 80%">
                <input id="textUf" type="text" />
            </td>
        </tr>
        <tr>
            <td style="width: 45%">
                Lattes:
            </td>
            <td style="width: 80%">
                <input id="textLates" type="text" />
            </td>
        </tr>
        <tr>
            <td style="width: 45%">
                Instituição:
            </td>
            <td style="width: 80%">
                <input id="textInstituicao" type="text" />
            </td>
        </tr>
        <tr>
            <td style="width: 45%">
                curso:
            </td>
            <td style="width: 80%">
                <input id="textCurso" type="text" />
            </td>
        </tr>
        <tr>
            <td style="width: 45%">
                Minicurriculo:
            </td>
            <td style="width: 80%">
                <input id="textMinicurriculo" type="text" />
            </td>
        </tr>
        </table>
        </fieldset>

         <fieldset style="width: 80%; margin: 20px">
       <legend><h3>Dados de Acesso</h3></legend>
    <table>

        <tr>
            <td style="width: 45%">
                Login:
            </td>
            <td style="width: 45%">
                <input id="textLogin" type="text" />
            </td>
        </tr>
        <tr>
            <td style="width: 45%">
                Email:
            </td>
            <td style="width: 80%">
                <input id="textEmail" type="text" />
            </td>
        </tr>
        <tr>
            <td style="width: 45%">
                Senha:
            </td>
            <td style="width: 80%">
                <input id="textSenha" type="password" />
            </td>
        </tr>
        <tr>
            <td style="width: 45%">
                Repetir Senha:
            </td>
            <td style="width: 80%">
                <input id="textRepetirSenha" type="password" />
            </td>
        </tr>

     </table>
        </fieldset>
    <br />
    <a class="buttonAcao" style="margin: 20px" href="javascript:window.location='GerenciarUsuarioAG.aspx';">Voltar</a>
    <a class="buttonAcao" href="javascript:cadastrarUsuario()">Enviar</a>
    <br />
   
    
</asp:Content>
